110 FOR X = 1 TO 11: READ P,D: & "BEEP",P,D *1.25: NEXT X: & "WAIT",1.5
120 DATA 47,5,0,5,37,15,0,5,47,5,0,10,63,5,0,5,37,15,0,5,31,7: REM " 1(C) 3(E) 1(C) 1(LO G) 3(E) 1(HI G)
150 PRINT M$:A$ = "AMPER SAMPLER I IS A COLLECTION OF A WIDE VARIETY OF USEFUL ROUTINES WRITTEN BY PETER MEYER, AUTHOR OF THE ROUTINE MACHINE, AND BY OTHER PROFESSIONAL PROGRAMMERS.": & "PRT",A$: GOSUB 8400: & "WAIT",11
160 PRINT M$:A$ = "THE ROUTINES COVER A WIDE RANGE, FROM NEW WAYS OF ACCESSING THE DISK DIRECTLY FROM BASIC, TO STRING MANIPULATION, TO SPEEDING UP APPLESOFT.": & "PRT",A$: GOSUB 8400: & "WAIT",11
170 PRINT M$:A$ = "LET'S TAKE A LOOK AT A FEW OF THEM NOW...": & "PRT",A$: GOSUB 8400: & "WAIT",6
200 HOME : GOSUB 8600: INVERSE : PRINT T$"CONTROLLED GET": NORMAL :A$ = "WILL GET A CHARACTER FROM THE KEYBOARD AND CHECK TO SEE IF IT ONE THAT YOU SPECIFIED AS ALLOWABLE.": & "PRT",A$: & "WAIT",10
210 PRINT :A$ = "NOW YOU CAN GET A KEY, AND CHECK TO MAKE SURE IT REALLY IS A 'Y/N', DIGIT, LETTER, ETC. -- AND DO IT ALL IN ONE STATEMENT!": & "PRT",A$: GOSUB 8400: & "WAIT",12
300 W = 24: GOSUB 8700: GOSUB 8600: INVERSE : PRINT T$"IF-THEN-ELSE": NORMAL :A$ = "EMULATES THE IF-THEN-ELSE CONSTRUCT FOUND IN MOST LARGER BASICS.": & "PRT",A$: & "WAIT",8
310 PRINT M$:A$ = "HERE'S A SUBROUTINE IN NORMAL BASIC:": & "PRT",A$: LIST 9000,9099: GOSUB 8400: & "WAIT",10
320 & "WINDOW",7:W = 10: GOSUB 8700: & "WINDOW",1: VTAB 8:A$ = "HERE'S THE SAME SUBROUTINE WITH 'IF-THEN-ELSE':": & "PRT",A$: PRINT
380 PRINT "9100 & "Q$"IF"Q$" A > B THEN C = A - B"M$" & "Q$"ELSE"Q$" C = B - A: PRINT"M$" "Q$"THE DIFFERENCE IS "Q$"C: RETURN": GOSUB 8400: & "WAIT",12
400 W = 24: GOSUB 8700: GOSUB 8600: INVERSE : PRINT T$"CATALOG ALPHABETIC SORT": NORMAL :A$ = "WILL SORT THE FILENAMES IN YOUR DISK'S DIRECTORY ALPHABETICALLY.": & "PRT",A$: & "WAIT",10
450 W = 14: GOSUB 8700: INVERSE : PRINT T$"FILE SELECTOR": NORMAL :A$ = "WILL LET YOUR USER SELECT A FILE WITHOUT HAVING TO TYPE ITS NAME.": & "PRT",A$: GOSUB 8500: & "WAIT",8
460 PRINT :A$ = "THE ROUTINE WILL SHOW, ONE AT A TIME, ALL FILE NAMES THAT CONTAIN A SPECIFIED CHARACTER STRING, AND LET YOUR USER SELECT THE ONE HE WANTS.": & "PRT",A$: GOSUB 8400: & "WAIT",12
500 W = 24: GOSUB 8700: GOSUB 8600: INVERSE : PRINT T$"CATALOG TO ARRAY": NORMAL :A$ = "PUTS THE CATALOG IN A STRING ARRAY, SO THAT YOUR PROGRAMS CAN LOOK AT IT.": & "PRT",A$: & "WAIT",8
510 PRINT :A$ = "YOU CAN SPECIFY THAT YOU WANT IT TO ONLY FIND FILES OF A PARTICULAR TYPE.": & "PRT",A$: GOSUB 8500: & "WAIT",8
530 N = 1:FT = 5: & "READ CAT",CT$(),N,FT: ON N <0 GOTO 60: PRINT :A$ = "HERE ARE ALL THE S-TYPE FILES THAT ARE ON THIS DISK:": & "PRT",A$: PRINT : FOR X = 1 TO N: PRINT X":" TAB( 4) MID$ (CT$(X),17): NEXT X: GOSUB 8400: & "WAIT",12
600 W = 24: GOSUB 8700: GOSUB 8600: INVERSE : PRINT T$"PRINT HEX": NORMAL :A$ = "LETS YOU PRINT NUMBERS IN BASE SIXTEEN:": & "PRT",A$: & "WAIT",4
610 PRINT : FOR X = 1 TO 5: FOR Y = 1 TO 2:N = INT( RND(1) *65536): HTAB 1 +19 *(Y = 2): PRINT N MID$ (SP$,1,(N <10000) +(N <1000) +(N <100) +(N <10))" = $";: & "PRINT HEX",N;: NEXT Y: PRINT : NEXT X: GOSUB 8400: & "WAIT",10
650 W = 14: GOSUB 8700: INVERSE : PRINT T$"PRINT BINARY": NORMAL :A$ = "LETS YOU PRINT NUMBERS IN BASE TWO:": & "PRT",A$: GOSUB 8500: & "WAIT",4
660 PRINT : FOR X = 1 TO 5: FOR Y = 1 TO 2:N = INT( RND(1) *255): HTAB 1 +19 *(Y = 2): PRINT N MID$ (SP$,1,(N <100) +(N <10))" = $";: & "PRINT BINARY",N;: NEXT Y: PRINT : NEXT X: GOSUB 8400: & "WAIT",12
900 HOME : GOSUB 8600: HTAB 12: INVERSE : PRINT "AMPER SAMPLER I": NORMAL : PRINT :A$ = "THE FOLLOWING ROUTINES ARE INCLUDED WITH 'AMPER SAMPLER I':": & "PRT",A$: PRINT : & "WAIT",5
910 FOR X = 1 TO 26:P = X -2 * INT((X -1)/2) -1: HTAB P *20 +1: READ A$: PRINT A$ MID$ ( CHR$(13),1,P = 1);: & "BEEP",15,1: NEXT X
920 & "WAIT",15: GOSUB 8400
930 GOTO 50
950 DATA "NUMBER INPUT","CATALOG MOD'S","STRING EXECUTE","IF-THEN-ELSE","DISK FILE DATA","WRITE PROTECT SENSE","CONTROLLED GET","CATALOG TO ARRAY","FP PROGRAM ERASE","PRINT HEX","FILE SELECTOR","SPEED UP APPLESOFT"